package com.zhilianbao.leyaogo.ui.activity.shoppingcart;

import android.os.Bundle;

import com.bql.fragmentation.anim.DefaultHorizontalAnimator;
import com.bql.fragmentation.anim.FragmentAnimator;
import com.bql.utils.EventManager;
import com.zhilianbao.leyaogo.R;
import com.zhilianbao.leyaogo.events.LeEventCode;
import com.zhilianbao.leyaogo.ui.activity.base.BaseOkHttpActivity;
import com.zhilianbao.leyaogo.ui.fragment.shoppingcart.ShoppingCartFragment;

/**
 * ClassName: ShoppingCartActivity <br>
 * Description:购物车 <br>
 * Author: Cyarie <br>
 * Created: 2016/12/8 16:46 <br>
 * Update Time：<br>
 * Update Description：<br>
 */
public class ShoppingCartActivity extends BaseOkHttpActivity {
    @Override
    protected int getContentViewLayoutID() {
        return R.layout.fragment_container;
    }

    @Override
    protected void initViewsAndEvents(Bundle savedInstanceState) {
        if (savedInstanceState == null) {
            loadRootFragment(R.id.fl_container, ShoppingCartFragment.newInstance(true));
        }
    }

    @Override
    protected FragmentAnimator onCreateFragmentAnimator() {
        return new DefaultHorizontalAnimator();
    }

    @Override
    protected boolean isBindEventBusHere() {
        return true;
    }

    @Override
    protected void onHandleEvent(EventManager eventManager) {
        super.onHandleEvent(eventManager);
        switch (eventManager.getEventCode()) {
            case LeEventCode.MSG_CODE_PAY_FINISH:
                finish();
                break;
        }

    }
}
